package com.xiejun;
import com.spring.XiejunApplicationContext;
import com.xiejun.service.IUserService;


public class Test {
    public static void main(String[] args) throws Exception {
        XiejunApplicationContext xiejunApplicationContext = new XiejunApplicationContext(AppConfig.class);
        //代理对象不是UserService的实例，不可以强制转换，只能依赖接口进行转换
        IUserService userService = (IUserService) xiejunApplicationContext.getBean("userService");
        System.out.println("第一次获取userService");
        userService.test(); //先执行代理逻辑，在执行test
    }
}